Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow deprecated use of Error::description #31

Merged
merged 1 commit into from
Jan 27, 2021

Conversation

haileys
Copy link
Contributor

@haileys haileys commented Jan 20, 2021

dogstatsd currently fails to compile:

error: use of deprecated associated function `std::error::Error::description`: use the Display impl or to_string()
  --> src/error.rs:25:41
   |
25 |             IoError(ref error) => error.description(),
   |                                         ^^^^^^^^^^^
   |
note: the lint level is defined here
  --> src/lib.rs:72:9
   |
72 | #![deny(warnings, missing_debug_implementations, missing_copy_implementations, missing_docs)]
   |         ^^^^^^^^
   = note: `#[deny(deprecated)]` implied by `#[deny(warnings)]`

This pull request fixes this with a #[allow(deprecated)] at the call site. This is a very conservative fix, and ordinarily I would prefer to remove the use of deprecated APIs, but since this call is in an implementation of Error::description on another type, it seems sensible to allow this.

@mcasper
Copy link
Owner

mcasper commented Jan 21, 2021

Hey @charliesome, thanks for catching that! I would agree with your first statement, let's just go ahead and fix the actual deprecation, I'm all for it. I imagine that means replacing the description function with source and just returning the IoError, but I haven't been doing much Rust lately and might be off the mark

@haileys haileys force-pushed the allow-deprecated-error-description branch from 718bd17 to febcde1 Compare January 27, 2021 06:13
@haileys
Copy link
Contributor Author

haileys commented Jan 27, 2021

@mcasper I have pushed up a new commit doing just that!

@mcasper mcasper merged commit 2a7445c into mcasper:master Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants